import { SharedEntity } from 'src/api/shared/entities/shared.entity';
import { Column, Entity } from 'typeorm';

@Entity('token')
export class TokenEntity extends SharedEntity {
  @Column({
    type: 'varchar',
    nullable: false,
    name: 'user_id',
    comment: '关联用户表的ID',
  })
  userId: string;

  @Column({
    type: 'varchar',
    nullable: false,
    length: 100,
    name: 'token',
    comment: 'token',
  })
  token: string;

  @Column({
    type: 'timestamp',
    name: 'expire_time',
    nullable: true,
    comment: '失效时间',
  })
  expireTime: Date;
}
